<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="resources/templates/mainTemplate.xhtml">
    
    <ui:param name="pagetitle" value="#{messages['index.welcome.title']}"/>
    
    <ui:define name="centerContent" class="turquaz">   
    
        <p:ajaxStatus onstart="statusDialog.show();" onsuccess="statusDialog.hide();"/>  

        <p:dialog appendToBody="true" resizable="false" modal="true" widgetVar="statusDialog" header="Loading"   
                  draggable="false" closable="false">  
            <p:graphicImage value="resources/images/ajax-loader.gif" />
        </p:dialog> 
        
        
        
        <ui:include src="search.xhtml" />
        
        
        <!-- ****************** LOGGED IN USER ************************ -->
        <h:panelGroup rendered="#{loginBean.isUser}" >
            
            <h:form id="indexForm" prependId="false" >
                <p:growl id="indexGrowl" showDetail="true" showSummary="false" life="5000" redisplay="false"  />
            </h:form>
            
            <h:panelGroup id="newsFeedPanel" rendered="#{!webResourceBean.searchFinished}">
                <ui:include src="newsFeed.xhtml" />
            </h:panelGroup> 
            
        </h:panelGroup> 
        
        <!-- ****************** GUEST ************************ -->
        <h:panelGroup id="guestNewContentID" rendered="#{!loginBean.loggedIn &amp;&amp; !webResourceBean.searchFinished}" >
            <ui:include src="newContent.xhtml" />
            <br/>
            <br/>
        </h:panelGroup> 
        
    </ui:define>
    
    
    
    
    
</ui:composition>

